package com.medata.service.impl;

import com.medata.dataObject.PicWord;
import com.medata.repository.PicWordRepository;
import com.medata.service.PicWordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author ：zb
 * @date ：Created in 2019/11/25 0025 10:08
 * @description：
 */
@Service
public class PicWordServiceImpl implements PicWordService {
    @Autowired
    private PicWordRepository repository;

    @Override
    @Transactional
    public void deleteByPhone(String phone) {
        repository.deleteByPhone(phone);
    }

    @Override
    public List<PicWord> getByPhone(String phone) {
        return repository.getByPhone(phone);
    }

    @Override
    public void saveOrUpdate(PicWord pw) {
        repository.save(pw);
    }

    @Override
    @Transactional
    public void deleteById(Integer id) {
        repository.deleteById(id);
    }

    @Override
    public PicWord getById(Integer id) {
        return repository.getById(id);
    }
}
